<?php

namespace app\teacher\utils;

class ErrorCode
{
    // 错误码
    const SUCCESS = 20000;
    const USRRNAME_PASSWORD_NOT_MATCH = 50001;
    const LOGIN_FAIL = 50002;
    const NO_AUTH = 50003;
    //  错误信息
    private $_message = [
        20000 => '成功',
        50001 => '账号或密码错误',
        50002 => '请登录',
        50003 => '没有权限'
    ];

    /**
     * 错误信息
     * @param $code 错误码 
     * @return string
     */
    public static function message($code)
    {
        $self = new self();
        return isset($self->_message[$code]) ? $self->_message[$code] : '';
    }
}
